﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.SqlClient;

namespace TMIS
{
    public partial class frmCommon : XtraForm
    {
        public frmCommon()
        {
            InitializeComponent();
        }
        #region 公共窗体公共功能方法申明
        public virtual void Save() { }
        public virtual void Priview() { }
        #endregion

        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Save();
                XtraMessageBox.Show("信息保存成功！");
                Priview();
            }
            catch (SqlException error)
            {
                #if DEBUG
                XtraMessageBox.Show(error.Message);
                #else
                XtraMessageBox.Show("信息保存失败！请检查所有信息！");
                #endif
            }
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            if (XtraMessageBox.Show("此窗口的所有更改将不被保存", "警告", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                this.Close();
            }
        }

        private void frmCommon_Load(object sender, EventArgs e)
        {
        }


    }
}
